<?php include "include/function_library.php"; ?>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php include "html/header.html"; ?>

</head>
<body class="tcuk home">

	<div id="wp">
	
		<?php  include "html/menu.html"; ?>
		
		<!-- CONTENT STARTS-->
		<div id="ct">	
			
			<?php 
				$id = get("id");
				$query = "SELECT oc.name, oc.phone, oc.tax_number, a.city, a.district, a.detail FROM organizer_company oc, address a WHERE oc.address_id=a.id AND oc.id=$id";
				$result = sql_query($query);
				
				$tuple = mysql_fetch_assoc($result);
				?>
				<table style="width:80%;height:100%">
					<tr>
						<td><img alt="" src="resource/organizer_company.jpg" width="250px"></td>			
						<td>
							<h2><?php echo $tuple["name"]; ?></h2><br />
							<ul>
								<li>Phone : <?php echo $tuple["phone"]; ?></li>
								<li>City : <?php echo $tuple["city"]; ?></li>
								<li>District : <?php echo $tuple["district"]; ?></li>
								<li>Tax Number : <?php echo $tuple["tax_number"]; ?></li>
								<li>Address : <?php echo $tuple["detail"]; ?></li>
							
							</ul>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div style="margin-top:10px; margin-left: 35px;"><h3>Tours organized by this company;</h3></div>
							<table border="" style="margin-top: 10px;">
							<thead>
								<tr>
									<th>Name</th>
									<th>Location</th>
									<th>Start Date</th>
									<th>End Date</th>
									<th>Type</th>
								</tr>
							</thead>
							<tbody>
								<?php
								$query = "SELECT * FROM tour WHERE organizer_company_id=$id";
								$result = sql_query($query);
								while ($tuple = mysql_fetch_assoc ( $result )) {
									?>
									<tr>
										<td><a href="tour_detail.php?id=<?php echo $tuple["id"]; ?>"><?php echo $tuple["name"]; ?></a></td>
										<td><?php echo $tuple["location"]; ?></td>
										<td><?php echo $tuple["start_date"]; ?></td>
										<td><?php echo $tuple["end_date"]; ?></td>
										<td><?php echo $tuple["type"]; ?></td>
									</tr>
									<?php
								}
								?>
							</tbody>
							</table>
						</td>
					</tr>
					
				</table>			
		
		</div> 	
		<!-- CONTENT ENDS-->		
		
		<?php include "html/footer.html"; ?>
		
	</div>
	
</body>
</html>